
import os

def read_basic_html(fileName, replace_map):
	if not os.path.exists(fileName): return ''

	fin = open(fileName,'r')
	val = fin.read().decode('utf8')

	for i, j in replace_map.items():
		#val = val.replace('<!-- access_key -->', access_key)
		val = val.replace(i, j)

	fin.close()
	return val

def redirect_page(page_name):
	redir = '<html>'
	redir += '<head>'
	redir += 	'<meta http-equiv="Refresh" content="0;url=/' + page_name + '">'
	redir += '</head>'
	redir += '<body>'
	redir += '</body>'
	redir += '</html>'
	return redir

